package it.efsw.plugin.sgs.db;

import static it.efsw.wf.WFManagerEx.WFManager;
import it.efsw.plugin.sgs.db.DBEnum_Sgs.TipoUnderl;
import it.efsw.plugin.sgs.db.DBEnum_Sgs.TipoVolatilita;
import it.efsw.plugin.sgs.db.DBEnum_Sgs.TipoCalcolo;
import it.efsw.plugin.sgs.resource.CONST;
import it.efsw.vdb.VField;
import it.efsw.vdb.VFieldEnum;
import it.efsw.vdb.VFieldOption;

import java.util.EnumSet;


public class DBAllotAttivo extends SgsTable {
    public VField                       id                      = new VField(this, "id_allotattivo",        WFManager.DefSchemaIDKey );
    public VField                       cod                     = new VField(this, "cod_allotattivo",       WFManager.DefSchemaCODSK );
//     public VField                       desc                    = new VField(this, "desc_allotattivo",      WFManager.DefSchemaDESC );

    public VField                       eliminato               = new VField(this, "eliminato",             WFManager.DefSchemaBOOLEAN );
    public VField                       data_ins                = new VField(this, "data_ins",              WFManager.DefSchemaDATETIME );
    public VField                       data_agg                = new VField(this, "data_agg",              WFManager.DefSchemaDATETIME );
    public VField                       id_azienda              = new VField(this, "id_azienda",            WFManager.DefSchemaID );
    public VField                       id_utente               = new VField(this, "id_utente",             WFManager.DefSchemaID );
    public VField                       id_procedura            = new VField(this, "id_procedura",          WFManager.DefSchemaID );

    public VField                       flag_ir                 = new VField(this, "flag_ir",               WFManager.DefSchemaBOOLEAN);
    public VField                       flag_fx                 = new VField(this, "flag_fx",               WFManager.DefSchemaBOOLEAN);
    public VField                       flag_pck                = new VField(this, "flag_pck",              WFManager.DefSchemaBOOLEAN);
    public VField                       f1                      = new VField(this, "f1",                    CONST.DefSchemaCOD100 );
    public VField                       f2                      = new VField(this, "f2",                    CONST.DefSchemaCOD100 );
    public VField                       f12                     = new VField(this, "f12",                   CONST.DefSchemaCOD100 );
    public VField                       cost_cono               = new VField(this, "cost_cono",             CONST.DefSchemaPREZZO );
    public VField                       sesselab                = new VField(this, "sesselab",              CONST.DefSchemaINTERO );
    public VFieldEnum<TipoVolatilita>   tipo_vola               = new VFieldEnum<TipoVolatilita>(TipoVolatilita.class, this, "tipo_vola",       WFManager.DefSchemaENUM,    EnumSet.of(VFieldOption.NOT_NULL_VALIDATED));
    public VFieldEnum<TipoUnderl>   	tipo_underl             = new VFieldEnum<TipoUnderl>(TipoUnderl.class, this, "tipo_underl",       WFManager.DefSchemaENUM,    EnumSet.of(VFieldOption.NOT_NULL_VALIDATED));

    public VField                       coeff_vola              = new VField(this, "coeff_vola",            CONST.DefSchemaPREZZO );
    public VField                       fs1                     = new VField(this, "fs1",                   CONST.DefSchemaCOD100 );
    public VField                       fs2                     = new VField(this, "fs2",                   CONST.DefSchemaCOD100 );
    public VField                       coeff_calcolo_ir        = new VField(this, "coeff_calcolo_ir",      CONST.DefSchemaPREZZO );
    public VFieldEnum<TipoCalcolo>      tipo_calcolo_ir         = new VFieldEnum<TipoCalcolo>(TipoCalcolo.class, this, "tipo_calcolo_ir",       WFManager.DefSchemaENUM,    EnumSet.of(VFieldOption.NOT_NULL_VALIDATED));
    
    public DBAllotAttivo() {
        super("AllotAttivo");
        setKeyField(id);
        setDefaultOrderBy( cod );
        setupBaseFields( id, cod, null );
        setupCommonFields(eliminato, id_azienda, data_ins, data_agg, id_utente, id_utente, null, null, id_procedura, id_procedura );
    }
}
